package com.fita.admin.dao;

import com.demo2do.core.persistence.annotation.Dao;
import com.demo2do.core.persistence.annotation.Query;
import com.demo2do.core.persistence.annotation.Variable;
import com.fita.entity.order.PaymentRequest;

/**
 * 
 * @author sjh
 *
 */

@Dao("hibernate")
public interface PaymentRequestDao {
	
	/**
	 * 
	 * @param code
	 * @return
	 */
	@Query("FROM PaymentRequest WHERE disabled = false AND orderCode = :code AND payCode != ''")
	public PaymentRequest load(@Variable("code") String code);

	/**
	 * 根据订单号查询支付请求
	 * @param orderCode
	 * @return
	 */
	@Query("FROM PaymentRequest WHERE disabled = false AND orderCode = :orderCode AND payCode IS NOT NULL")
	PaymentRequest loadByOrderCode(@Variable("orderCode") String orderCode);
}
